/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.kungkhies.persistence.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author clayton
 */
@Entity 
@Table(name = "ilo_canonical")
@XmlRootElement
@NamedQueries(
{
    @NamedQuery(name = "IloCanonical.findAll", query = "SELECT i FROM IloCanonical i"),
    @NamedQuery(name = "IloCanonical.findByIloCanonicalId", query = "SELECT i FROM IloCanonical i WHERE i.iloCanonicalId = :iloCanonicalId"),
    @NamedQuery(name = "IloCanonical.findByIloCanonicalText", query = "SELECT i FROM IloCanonical i WHERE i.iloCanonicalText = :iloCanonicalText")
})
public class IloCanonical implements Serializable 
{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ilo_canonical_id")
    private Long iloCanonicalId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2048)
    @Column(name = "ilo_canonical_text")
    private String iloCanonicalText;
    @JoinColumn(name = "ilo_id", referencedColumnName = "ilo_id")
    @ManyToOne(optional = false)
    private Ilo iloId;

    public IloCanonical()
    {
    }

    public IloCanonical(Long iloCanonicalId)
    {
        this.iloCanonicalId = iloCanonicalId;
    }

    public IloCanonical(Long iloCanonicalId, String iloCanonicalText)
    {
        this.iloCanonicalId = iloCanonicalId;
        this.iloCanonicalText = iloCanonicalText;
    }

    public Long getIloCanonicalId()
    {
        return iloCanonicalId;
    }

    public void setIloCanonicalId(Long iloCanonicalId)
    {
        this.iloCanonicalId = iloCanonicalId;
    }

    public String getIloCanonicalText()
    {
        return iloCanonicalText;
    }

    public void setIloCanonicalText(String iloCanonicalText)
    {
        this.iloCanonicalText = iloCanonicalText;
    }

    public Ilo getIloId()
    {
        return iloId;
    }

    public void setIloId(Ilo iloId)
    {
        this.iloId = iloId;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (iloCanonicalId != null ? iloCanonicalId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof IloCanonical))
        {
            return false;
        }
        IloCanonical other = (IloCanonical) object;
        if ((this.iloCanonicalId == null && other.iloCanonicalId != null) || (this.iloCanonicalId != null && !this.iloCanonicalId.equals(other.iloCanonicalId)))
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "com.kungkhies.persistence.entities.IloCanonical[ iloCanonicalId=" + iloCanonicalId + " ]";
    }

}
